import LoginView from '@/views/LoginView.vue'
import Student from '@/views/student/MainView.vue'
import Teacher from '@/views/teacher/MainView.vue'
import CourseView from '@/views/student/CourseView.vue'
import CourseGradeView from '@/views/student/CourseGradeView.vue'
import CourseChooseView from '@/views/student/CourseChooseView.vue'
import CourseChooseResView from '@/views/student/CourseChooseResView.vue'
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: '',
            component: LoginView
        },
        {
            path: '/login',
            name: 'login',
            component: LoginView
        },
        {
            //学生端
            path: '/student',
            name: 'student',
            component: Student,
            redirect: '/student/courseInfo',
            children: [
                {
                    path: '/student/courseInfo',
                    name: 'courseInfo',
                    component: CourseView
                },
                {
                    path: '/student/courseGrade',
                    name: 'courseGrade',
                    component: CourseGradeView,
                },
                {
                    path: '/student/chooseCourse',
                    name: 'chooseCourse',
                    component: CourseChooseView,
                },
                {
                    path: '/student/chooseResult',
                    name: 'chooseResult',
                    component: CourseChooseResView,
                }
            ]
        },
        {
            //老师端
            path: '/teacher',
            name: 'teacher',
            component: Teacher,
            redirect: '',
            children: [
                {
                    path: '/',
                    name: '',
                },
            ]
        },
    ]
})

export default router